module.exports = (options, app) => {
    return async function(ctx, next) {
        try {
            await next();
        } catch (e) {
            if (e.status === 401) {
                ctx.status = 401;
                ctx.body = {
                    code: -1,
                    msg: '身份过期,重新登录'
                };
            }
        }
    }
}